package file.day9_24.day08;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class IteratorDemo {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        c.add("a");
        c.add("b");
        c.add("c");

        Iterator it = c.iterator();

        while (it.hasNext()){
//            String str = (String) it.next();
//            System.out.println(str);
            System.out.println(it.next());//返回的是Object类型
        }
    }
}
